package TestClasses;

import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ModelLayer.*;
import DBLayer.*;

public class DBStockTest {
	
	DBStock dbs = new DBStock();

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetAllStocks() {
		ArrayList<Stock> s = dbs.getAllStocks(false);
	    System.out.println(s.size());
	}

	@Test
	public void testFindStock() {
		Stock s = dbs.findStock(1);
		System.out.println(s.getLocationName());
	}

	@Test
	public void testSearchStockName() {
		Stock s = dbs.searchStockName("Van");
		System.out.println(s.getLocationName());
	}

/*	@Test
	public void testInsertStock() throws Exception{
		Stock sObj = new Stock(7, "Camper");
		dbs.insertStock(sObj);
	}*/

/*	@Test
	public void testUpdateStock() {
		Stock sObj = new Stock(3, "Campervan");
		dbs.updateStock(sObj);
	}*/

	@Test
	public void testDeleteStock() {
		dbs.deleteStock(3);
		ArrayList<Stock> stocks = dbs.getAllStocks(false);
		System.out.println(stocks.size());
	}

}
